<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <title>韧在维达，乐在全家</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=750, maximum-scale=1.0, user-scalable=no"/>
    <link href="./js/app.css" rel="stylesheet">
    <script src="./js/jquery.js"></script>
</head>
<script src="./js/app.js">
</script>
<body style="margin: 0;padding: 0;">

<img id="guize-image" src="https://bzweida.oss-cn-beijing.aliyuncs.com/weida/baoming.png" style="width: 100%;height: auto;position: absolute;">
<div style="flex-direction: column;display: flex;align-items: center;;;width: 100%;height: 63em;background-color: transparent;position: absolute;top: 0;left: 0;z-index: 100;">
    <div style="width: 20em;height: 3.5em;;margin-top: 37em;">
        <input id="name-input" style="outline: none;width: 100%;height: 100%;background-color: transparent;border-radius: 0;border: none;font-size: 2em;color: white">
    </div>
    <div style="width: 20em;height: 3.5em;;margin-top: 5.5em;">
        <input id="phone-input" style="width: 100%;height: 100%;background-color: transparent;border-radius: 0;border: none;font-size: 2em;color: white">
    </div>
    <div id="sub-click" style=";width: 20em;height: 4.5em;;margin-top: 8.5em;">

    </div>

</div>
<script>

    $(document).ready(function () {




        function sub() {
            var name =  $('#name-input').val();
            var phone =  $('#phone-input').val();
            if(name.length == 0){
                alert('请输入姓名!');
                return;
            }
            if (name.length>5){
                alert('姓名太长啦!');
                return;
            }
            if(!checkPhone(phone)){
                return;
            }

            $.get(api.saveUserByNameAndPhone+'?phone='+phone+'&username='+name,function (res) {
                //跳转页面
                window.localStorage.setItem('phone',phone);
                if(res.message == '0'){
                    window.location.href = './paiming.html';
                }else{
                    window.location.href = './shangchuan.html';
                }


            });


        }

        $('#sub-click').click(function () {
            sub();
        })




    })

</script>
</body>


</html>
